{% extends "base.html" %}
{% block content %}
<div class="posts">
    {% for post in post_list %}
    <div id='content' class='row-fluid'>
        <section class="post">
            <header class="post-header">
                <h2 class="post-title">
                    <a href="{% url 'detail' id=post.id %}">{{ post.title }}</a>
                </h2>
                    <p class="post-meta">
                      Time:  <a class="post-author" href="#">{{ post.date_time}}</a>
						          <a class="post-category post-category-js" href="{% url 'search_tag' tag=post.label %}" style="float: right">{{ post.label|title }}
                        </a>
                    </p>
            </header>

                <div class="post-description">
                    <p>
                        {% autoescape off %}
                    		{{ post.content|truncatewords_html:50  }}
                    		{% endautoescape %}
                        
                    </p>
                </div>
				 <div class="textfoot">
					<a href="{% url 'detail' id=post.id %}" style="float: right">阅读全文</a>
				</div>
            
        </section>
    </div>
    <br>
    {% endfor %}

	{% if post_list.object_list and post_list.paginator.num_pages > 1 %}

    <div id='content' class='row-fluid'>
      <div class="text-center">
      {% if post_list.has_previous %}
        <a href="?page={{ post_list.previous_page_number }}">上一页</a>
      {% endif %}

      {% if post_list.has_next %}
        <a href="?page={{ post_list.next_page_number }}">下一页</a>
      {% endif %}
     
      </div>
      </div>
    {% endif %}
</div><!-- /.blog-post -->
{% endblock %}